package com.black.auth.wechat.service.impl;

import cn.binarywang.wx.miniapp.api.WxMaUserService;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
import com.black.auth.wechat.service.WxMiniAppService;
import lombok.RequiredArgsConstructor;
import me.chanjar.weixin.common.error.WxErrorException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author linwenfeng
 */
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class WxMiniAppServiceImpl implements WxMiniAppService {

    private final WxMaUserService wxMaUserService;

    @Override
    public WxMaJscode2SessionResult getCode2SessionInfo(String jsCode) throws WxErrorException {
       return wxMaUserService.getSessionInfo(jsCode);
    }
}
